
//
//  Entry.swift
//  SwiftyDSA
//
//  Created by Archer on 2018/8/20.
//  Copyright © 2018年 Archer. All rights reserved.
//

import Foundation

/// 词条 key-value pair
public struct Entry<Key: Comparable, Value> {
    let key: Key
    let value: Value
}

extension Entry: Comparable {
    public static func < (lhs: Entry<Key, Value>, rhs: Entry<Key, Value>) -> Bool {
        return lhs.key < rhs.key
    }
    
    public static func == (lhs: Entry<Key, Value>, rhs: Entry<Key, Value>) -> Bool {
        return lhs.key == rhs.key
    }
}
